﻿@model Hetang.Areas.User.Models.Classes.ResetPassword
@using Hetang.Models.ControlExtensions
@{
    ViewBag.Title = "重置密码";
    Layout = "~/Views/Shared/_Layout.cshtml";
}


@if (!string.IsNullOrEmpty(Request["code"]))
{
    <div class="container well well-small top80">
        <div class="row-fluid">
            <div class="span12">
                @using (Html.BeginForm("index", "changepwd", FormMethod.Post, new { @class= "form-horizontal form-signin" }))
                {
                <h3>重置密码</h3>
                <hr />
                <div class="control-group">
                    @Html.LabelFor(x => x.Password)
                    @Html.PasswordFor(x => x.Password, new { @class = "input-block-level", maxlength = 16 })
                    @Html.ValidationMessageFor(x => x.Password)
                </div>
                <div class="control-group">
                    @Html.LabelFor(x => x.ConfigPassword)
                    @Html.PasswordFor(x => x.ConfigPassword, new { @class = "input-block-level", maxlength = 16 })
                    @Html.ValidationMessageFor(x => x.ConfigPassword)
                </div>
                <div class="top20">
                    @Html.HiddenFor(x => x.Code, new { value = Request["code"] })
                    <button type="submit" class="cbtn cbtn-info">提交</button>
                </div>
                @Html.GetJavascript("jquery.validate.min.js")
                @Html.GetJavascript("jquery.validate.unobtrusive.min.js")
                }
            </div>
        </div>
    </div>
}
else
{
    <div class="container top80">
        <div class="row-fluid">
            <div class="span12">
                <div class="hero-unit top80" style="margin-bottom:100px">
                    <h1>发生了点错误！</h1>
                    <p>I'm very sorry, 阁下没有提供重置码或重置码已经过期。10秒后自动返回首页。</p>
                    <p>
                        @Html.ActionLink("点击这里手动返回首页", "index", "home", new { @class="btn btn-large btn-primary" })
                    </p>
                    <script type="text/javascript">
                        setTimeout(function () {
                            location.href = "/";
                        }, 10000);                        
                    </script>
                </div>
            </div>
        </div>
    </div>
}